<%--
  Created by IntelliJ IDEA.
  User: Dushine2008
  Date: 2021/7/29
  Time: 11:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>用户列表</title>

        <!-- Bootstrap -->
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
              integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

        <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    </head>
    <body>
        <div class="container">
            <h1 align="center">用户列表</h1>
            <table class="table table-hover">
                <tr>
                    <th class="col-xs-1">编号</th>
                    <th class="col-xs-1">星宿</th>
                    <th class="col-xs-1">昵称</th>
                    <th class="col-xs-1">姓名</th>
                    <th class="col-xs-1">地址</th>
                    <th class="col-xs-4">信息</th>
                    <th class="col-xs-3">操作</th>
                </tr>

                <c:forEach items="${shuiHus}" var="shuiHu">
                    <tr>
                        <td>${shuiHu.id}</td>
                        <td>${shuiHu.star}</td>
                        <td>${shuiHu.nickname}</td>
                        <td>${shuiHu.username}</td>
                        <td>${shuiHu.addr}</td>
                        <td>${shuiHu.info}</td>
                        <td>
                            <a type="button" class="btn btn-info">修改</a>
                            <button type="button" class="btn btn-danger" onclick="delUser(${shuiHu.id})">删除</button>
                        </td>
                    </tr>
                </c:forEach>
            </table>
        </div>
    </body>
</html>

<script type="text/javascript">
    function delUser(id) {
        var con = confirm("确定删除?");
        if (con){
            alert("删除编号:" + id + "的用户");
        } else{
            alert("取消操作");
        }
    }
</script>
